package com.bandroid.demo.view;

import android.os.Bundle;
import android.view.View;

import com.bandroid.demo.R;
import com.bandroid.demo.base.MyActivity;
import com.base.balibrary.base.BaseActivity;
import com.base.balibrary.ioc.BaseContentView;
import com.base.balibrary.view.custom.CarouselRelativeLayout;
import com.base.balibrary.view.custom.menu.SlidingMenu;

/**
 * BAndroid
 * Created by YichenZ on 2015/8/31 09:44.
 */
@BaseContentView(R.layout.activity_sliding_menu)
public class MenuActivity extends MyActivity {
    SlidingMenu slidingMenu;
    View leftView,centerView,rightView;

    CarouselRelativeLayout carouseRl;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initUI();
        initData();
    }

    private void initData() {
        Object[] url=new String[]{ "http://pic.nipic.com/2007-11-09/2007119122519868_2.jpg", "http://pic.nipic.com/2007-11-09/2007119122519868_2.jpg", "http://pic.nipic.com/2007-11-09/2007119122519868_2.jpg"};
        carouseRl.show(url);
    }

    private void initUI() {
        leftView=getLayoutInflater().inflate(R.layout.activity_main,null);
        centerView=getLayoutInflater().inflate(R.layout.activity_listview,null);
        rightView=getLayoutInflater().inflate(R.layout.activity_main,null);

        carouseRl=(CarouselRelativeLayout) centerView.findViewById(R.id.carouselRl);

        slidingMenu = (SlidingMenu) findViewById(R.id.slidingMenu);
        slidingMenu.setLeftView(leftView);
        slidingMenu.setRightView(rightView);
        slidingMenu.setCenterView(centerView);
    }
}
